Parabola Rotation

A parabola is rotated away from vertical by introducing $xy$ and $y^{2}$ terms into the general equation. There is only one parabola equation. It is $$4p(y-k)=(x-h)^{2}.$$ However, we can substitute a set of axis rotations for $x$ and $y$ and in so doing, we create two new terms in the general equation. The substitutions are $$x=x'\cos\theta+y'\sin\theta$$ $$y=-x'\sin\theta+y'\cos\theta.$$ We might as well account for the $(h,k)$ vertex offset at the same time. That makes the substitution be $$\left(\begin{array}{c} x=(x'-h)\cos\theta+(y'-k)\sin\theta\\ y=-(x'-h)\sin\theta+(y'-k)\cos\theta. \end{array}\right)$$ Now the parabola equation becomes $4p\left[-(x'-h)\sin\theta+(y'-k)\cos\theta\right]=(x'\cos\theta+y'\sin\theta)^{2}$. It is easiest to let the substitutions be their own functions. $$\left(\begin{aligned}a(x,y)= & (x-h)\cos\theta+(y-k)\sin\theta\\ b(x,y)= & -(x-h)\sin\theta+(y-k)\cos\theta \end{aligned} \right)$$ Then the parabola equation is $$4p\left(b(x,y)\right)=\left(a(x,y)\right)^{2}$$

Solving a Rotated Parabola

Given a general form parabola equation, $Ax^{2}+Bxy+Cy^{2}+Dx+Ey+F=0$, we want to find its Focus, Directrix, and Vertex.

Begin with the matrix of Quadratic Form and get the eigenvalues and eigenvectors. Notice that for the parabola, we have replaced $C$ with $B^{2}/(4A)$. It has to be that. The only exception is when the directrix is vertical and the $x^{2}$ term and hence the $A$ coefficient disappears. In that case, it is alread an “aligned” parabola, although aligned sideways. $$Q=\left(\begin{array}{cc} A & B/2\\ B/2 & {\displaystyle \frac{B^{2}}{4A}} \end{array}\right)$$ For the parabola the eigenvalues and eigenvectors are truly easy. $$\left(\begin{array}{c} \lambda_{1}\\ \lambda_{2} \end{array}\right)=\left(\begin{array}{c} 0\\ {\displaystyle \frac{4A^{2}+B^{2}}{4A}} \end{array}\right)$$ $$\mathbf{e}_{1}=\left(\begin{array}{c} -B\\ 2A \end{array}\right)\quad\quad\mathbf{e_{2}}=\left(\begin{array}{c} 2A\\ B \end{array}\right) \tag{1} \label{1}$$ The zero eigenvalue and its vector, $\mathbf{e_{1}}$, match with the major axis, and the other eigenvalue matches with the directrix.

If we choose to rotate the parabola so that it is vertical, then we have a simple quadratic function, which is solved by the method of section Vertical Aligned Vertex Equation or Symbolic Algebra 2.

Rotation

This section shows how to rotate a parabola to be aligned vertically. While we can use $\cot(2\theta)=(A-C)B$ to find the “angle of rotation”, that $\theta$ may result in a rotation to either vertical or horizontal as $-\pi/4\le\theta\le\pi/4$. The method we will show here, will find the directrix angle, $\varphi$ as $-\pi/2\le \varphi \le\pi/2$ and we can rotate to be aligned with the y-axis.

We can get the amount that the parabola is rotated from the directrix eigenvector. Computed as $\mathbf{e_{2}}=\left(\begin{array}{c} 2A\\ B \end{array}\right)$, the eigenvector will always be in either “the first or fourth” quadrant (Case I), or the “second and third” quadrant (Case II) . The value of $\varphi$ in the first case will vary from $-90^{\circ}<\varphi<90^{\circ}$ and in the second case it will vary from $90^{\circ}<\varphi<180^{\circ}$. The difference between the cases is that Case I has a positive coefficient on $x^{2}$ and for Case II it is negative. $$\varphi=atan2(\mathbf{e_{2y}},\mathbf{e_{2x}}).$$ Then we want to rotate the parabola equation by $-\varphi$ to align it with the $y$-axis. The substitution to rotate a Cartesian equation by some angle $\theta$ is $$\text{let }x=x\cos\theta+y\sin\theta$$ $$\text{let }y=-x\sin\theta+y\cos\theta$$ substituted into $Ax^{2}+Bxy+Cy^{2}+Dx+Ey+F=0$. Once aligned, we will have an equation of the form $$ax^{2}+bx+cy+d=0$$ The form was covered in section Symbolic Algebra 2. If it is vertical, then there should be no $xy$ term and no $y^{2}$ term. This can be put into the form $$4p(y-k)=(x-h)^{2}$$ where $(h,k)$ is the vertex and $p$ is the distance from the vertex to the focus as well as the directrix. Although $p$ is a positive distance, it may correctly calculate as a negative number. That is because, depending on the amount of rotation, eigenvector $\mathbf{e_{1}}$ will either point toward the focus or away from the focus. That is, the vertical aligned parabola may be open up or open down. $$F=(h,k+p).$$ To place the focus,$F$, onto the rotated parabola, we have to rotate it counter-clockwise using $\varphi$.

Example: Given the parabola $3x^{2}+2\sqrt{3}xy+y^{2}+x\left(1-8\sqrt{3}\right)-y\left(8+\sqrt{3}\right)+22=0$, find it focus, directrix, and vertex.
Answer: Let's name the constants. $\left(\begin{array}{ccc} A=3 & B=2\sqrt{3} & C=1\\ D=\left(1-8\sqrt{3}\right) & E=\left(-8-\sqrt{3}\right) & F=22 \end{array}\right)$ Begin by identifying the angle of rotation needed to remove the $xy$ term. There are two ways. First, $\cot(2\theta)=(C-A)/B$. Since $(C-A)\ne 0$, $$\tan(2\theta)=\frac{B}{(C-A)}$$ and $$\theta=\frac{{\displaystyle \tan^{-1}\left(\frac{B}{(C-A)}\right)}}{2}=\frac{1}{2}k\pi-\frac{1}{6}\pi,\text{for k}\in \mathbb{N}$$ The second way is $$\text{directrix vector}=\left(\begin{array}{c} 2A\\ B \end{array}\right)=\left(\begin{array}{c} 6\\ 2\sqrt{3} \end{array}\right)$$ $$\varphi=-atan2\left(2\sqrt{3},6\right)$$ Now do the rotation. Substitute $x'$ and $y'$ terms into the given parabola. Then collect terms, Let, $$\left(\begin{array}{c} x=x'\cos\varphi+y'\sin\varphi\\ y=-x'\sin\varphi+y'\cos\varphi \end{array}\right)$$ $$\begin{aligned} & 3\left(x'\cos\varphi+y'\sin\varphi\right)^{2}\\ + & 2\sqrt{3}\left(x'\cos\varphi+y'\sin\varphi\right)\left(-x'\sin\varphi+y'\cos\varphi\right)\\ + & \left(-x'\sin\varphi+y'\cos\varphi\right)^{2}\\ + & \left(x'\cos\varphi+y'\sin\varphi\right)\left(1-8\sqrt{3}\right)\\ - & \left(-x'\sin\varphi+y'\cos\varphi\right)\left(8+\sqrt{3}\right)\\ + & 22=0 \end{aligned} $$ After collecting terms, we get $$4\left(x'\right)^{2}-16\left(x'\right)-2\left(y'\right)+22=0$$ and we can identify coefficients of this vertical parabola as $$\left(\begin{aligned}a= & 4\\ b= & -16\\ c= & -2\\ d= & 22 \end{aligned} \right)$$ Next use the equation of section Symbolic Algebra 2 to get $h$,$k$,and $p$. $$\left(\begin{aligned}h= & -{\displaystyle \frac{b}{2a}}\\ k= & {\displaystyle \frac{b^{2}-4ad}{4ac}}\\ p= & -{\displaystyle \frac{c}{4a}} \end{aligned} \right)$$ $$\left(\begin{aligned}h= & -{\displaystyle \frac{-16}{2\cdot4}}\\ k= & {\displaystyle \frac{\left(-16\right)^{2}-4\cdot4\cdot22}{4\cdot4\cdot(-2)}}\\ p= & -{\displaystyle \frac{-2}{4\cdot4}} \end{aligned} \right)=\left(\begin{array}{c} h=2\\ k=3\\ p=1/8 \end{array}\right)$$ Next compute the focus and directrix of the vertical parabola. $$V=(h,k)=(2,3)$$ $$Focus=(h,k+p)=\left(2,25/8\right)$$ $$\text{Directrix: }y=k-p=\frac{23}{8}$$ Next rotate the two points. To avoid confusion, in this numeric problem, $\varphi=-\frac{1}{6}\pi$,so $-\varphi=+\frac{1}{6}\pi$ $$Rotate(V,-\varphi)=\left(\begin{array}{c} x=V_{x}\cos(-\varphi)-V_{y}\sin(-\varphi)\\ y=V_{x}\sin(-\varphi)+V_{y}\cos(-\varphi) \end{array}\right)$$
Example1_1.14.4.png
Figure 1: Starting with the parabola $3x^{2}+2\sqrt{3}xy+y^{2}+x\left(1-8\sqrt{3}\right)-y\left(8+\sqrt{3}\right)=-22$, find the Vertex and Directrix and Focus. The original parabola is shown in black (Rotated) and the vertical aligned one is shown in red.
$$V_{orig}=\left(\begin{array}{c} {\displaystyle 2\cdot\frac{\sqrt{3}}{2}-3\cdot\frac{1}{2}}\\ {\displaystyle 2\cdot\frac{1}{2}+3\cdot\frac{\sqrt{3}}{2}} \end{array}\right)=\left(0.232,3.598\right)$$ Similarly $Rotate(F,-\varphi)=(0.170,3.706)$ and to rotate the directrix, we have to use the equation rotation, but only the $y$ term since our vertical directrix has no $x$ term. $$\text{Directrix: }-x\sin(-\varphi)+y\cos(-\varphi)=k-p$$ $$\frac{1}{2}\sqrt{3}y-\frac{1}{2}x=\frac{23}{8}$$
Example: Given the parabola $5\;x^{2}+\frac{1}{5}\;y^{2}+2\;x\;y-x-36\;y=-3$, find its focus, directrix, and vertex.
Answer: From equation $\eqref{1}$ we can immediately write the axis vectors. $$\text{major axis direction }\mathbf{ev_{1}}=\left(\begin{array}{c} -1\\ 5 \end{array}\right)$$ $$\text{directrix direction }\mathbf{ev_{2}}=\left(\begin{array}{c} 5\\ 1 \end{array}\right)$$ and the amount to rotate is $$\varphi=-atan2(1,5)=-0.19739556\,rad$$ Setting up the rotation equation: $$\begin{aligned} & 5\;(x\cos\varphi+y\sin\varphi)^{2}\\ & +\frac{1}{5}\;(-x\sin\varphi+y\cos\varphi)^{2}\\ & +2\;(x\cos\varphi+y\sin\varphi)\;(-x\sin\varphi+y\cos\varphi)\\ & -(x\cos\varphi+y\sin\varphi)\\ & -36\;(-x\sin\varphi+y\cos\varphi)=-3 \end{aligned} $$ Which, as expected, reduces to $$\frac{26}{5}\;x^{2}-\frac{41}{26}\;\sqrt{26}\;x-\frac{179}{26}\;\sqrt{26}\;y=-3 \tag{2} \label{2}$$ Putting this into $(x-h)^{2}=4p(y-k)$ by completing the square can be done but is rather tedious and prone to error. Instead, we will use the equations derived in Symbolic Algebra 2.
Example_1.14.4.png
Figure 2: Starting with the parabola $5x^{2}+2xy+\frac{1}{5}y^{2}-x-36y=-3$, find the Vertex and Directrix and Focus. The original parabola is shown in black (Rotated) and the vertical aligned one is shown in red.
$$\left(\begin{aligned}h= & -{\displaystyle \frac{b}{2a}}\\ k= & {\displaystyle \frac{b^{2}-4ad}{4ac}}\\ p= & -{\displaystyle \frac{c}{4a}} \end{aligned} \right)$$ $$\left(\begin{array}{c} h\approx0.773\\ k\approx-0.00309\\ p\approx1.6877 \end{array}\right)$$ $$\begin{aligned}V= & (0.773,-0.00309)\\ F= & (0.773,1.6846)\\ y= & -1.6908 \end{aligned} $$ We still have to un-rotate each of the points to get the Vertex, focus, and directrix of the original parabola. If I hurry through that, the results are $$V_{orig}=\left(\begin{array}{c} V_{x}\cos(-\varphi)-V_{y}\sin(-\varphi)\\ V_{x}\sin(-\varphi)+V_{y}\cos(-\varphi) \end{array}\right)$$ $$V_{orginal}\approx\left(\begin{array}{c} 0.7587\\ 0.1486 \end{array}\right)$$ $$Foc=\left(\left(\begin{array}{c} F_{x}\cos(-\varphi)-F_{y}\sin(-\varphi)\\ F_{x}\sin(-\varphi)+F_{y}\cos(-\varphi) \end{array}\right)\right)$$ $$Foc=\left(\begin{array}{c} 0.4278\\ 1.804 \end{array}\right)$$ For the directrix rotation, we have to switch back to how equations are rotated, but rotate the directrix back into place. We only substitute for $y$ because the vertical directrix equation as no $x$. $$-x\sin(-\varphi)+y\cos(-\varphi)=1.6908$$ which can be changed to $y\approx0.2x-1.7243$.

Solve Without Rotation

Suppose we want to just solve the non-aligned parabola without all this rotation aggravation? We can. It isn't much easier, but we can. Let's begin with a figure.

RotParabDerive_Way2a.png
Figure 3: A non-aligned parabola is shown with its Focus and directrix. A point, $P$, is located somewhere on the parabola and a perpendicular line is constructed going to the directrix. Using the slope, $m$, of the directrix, we are able to write the line equation from $P$ to $Q$ and then we can solve the two lines simultaneously to obtain the coordinates of point $Q$.

In figure 3 we have coordinates for points $Foc,P,$ and $Q$ which are all that is needed to apply the definition of a parabola. $$\Vert P-Foc\Vert=\Vert P-Q\Vert \tag{3} \label{3}$$ In the figure, we have defined the coordinates of $P$ as $(x,y)$ but when defining $Q$, we used $P_{x}$ and $P_{y}$. That was just so we could solve for the coordinates of $Q$, but now we will change to let $x=P_{x}$ and $y=P_{y.}$ So $$Q=\left(\frac{x-my-mb}{m^{2+1}},\frac{mx+m^{2}y+b}{m^{2}+1}\right).$$ Now let's apply $\eqref{3}$. $$\sqrt{(x-r)^{2}+(y-s)^{2}}=\sqrt{\left(x-\frac{x-my-mb}{m^{2+1}}\right)^{2}+\left(y-\frac{mx+m^{2}y+b}{m^{2}+1}\right)^{2}} \tag{4} \label{4}$$ So equation $\eqref{4}$ is a parabola equation, but not very pretty. When we use a parabola equation, it is typically to try and find the focus, $Foc(r,s)$ and the directrix, $y=mx+b$. The problem with $\eqref{4}$ is that those values, $m,b,r,s$ were what we started with in the quick derivation. What we will do next is to expand $\eqref{4}$ and look at the coefficients of the parabolic terms, that is, the coefficients of $Ax^{2}+Bxy+Cy^{2}+Dx+Ey+F=0$. After a bit of algebra, the coefficients are $$\begin{aligned}A= & 1\\ B= & 2m\\ C= & m^{2}\\ D= & -2bm-2m^{2}r-2r\\ E= & 2b-2m^{2}s-2s\\ F= & -b^{2}+m^{2}r^{2}+m^{2}s^{2}+r^{2}+s^{2} \end{aligned} $$ These coefficients were all divided by $(m^{2}+1)$ and we multiplied through by that (zero is on the right) to remove it. A minor problem with the set of coefficients is that it requires for $A=1$. To get that form, we must take the general form and divide through by $A$ to make it $1$ and define $B,C,D,E,F$ where each has been divided by $A$. Therefore, the parabola equation will be $$x^{2}+Bxy+Cy^{2}+Dx+Ey+F=0.$$ The slope of the directrix is easily solved from coefficient $B$. Then, coefficients $D,E,$ and $F$ make three equations in the unknowns $b,r,s$. There solution is $$\begin{aligned}b= & \frac{-\left(D^{2}+E^{2}\right)+4F\left(m^{2}+1\right)}{4\left(mD-E\right)}\\ r= & \frac{-D^{2}m+2DE+E^{2}m-4\;Fm^{3}-4Fm}{4Dm^{3}+4Dm-4Em^{2}-4E}\\ s= & \frac{-D^{2}-2DEm+E^{2}+4Fm^{2}+4F}{4Dm^{3}+4Dm-4Em^{2}-4E} \end{aligned} $$

Example: Given the Parabola $x^{2}-3xy+\frac{1}{4}y^{2}+15x-7y=-55$, find the vertex.
Answer: The way to find the vertex is to get the focus and directrix and find the halfway point of the line in between them. First, we need $m$. $$2m=-3$$ $$m=-3/2$$ Calculate the values for $r,s,$ and $b$. The focus will be $(r,s)$. $$r=\frac{-4\;F\;\left(-\frac{3}{2}\right)^{3}-D^{2}\;\left(-\frac{3}{2}\right)+E^{2}\;\left(-\frac{3}{2}\right)+2\;D\;E-4\;F\;\left(-\frac{3}{2}\right)}{4\;D\;\left(-\frac{3}{2}\right)^{3}-4\;E\;\left(-\frac{3}{2}\right)^{2}+4\;D\;\left(-\frac{3}{2}\right)-4\;E}=\frac{-2253}{403}\approx-5.59$$ $$s=\frac{4\;F\;\left(-\frac{3}{2}\right)^{2}-2\;D\;E\;\left(-\frac{3}{2}\right)-D^{2}+E^{2}+4\;F}{4\;D\;\left(-\frac{3}{2}\right)^{3}-4\;E\;\left(-\frac{3}{2}\right)^{2}+4\;D\;\left(-\frac{3}{2}\right)-4\;E}=\frac{-448}{403}\approx-1.11$$ $$b=\frac{4\;F\;\left(-\frac{3}{2}\right)^{2}-D^{2}-E^{2}+4\;F}{4\;D\;\left(-\frac{3}{2}\right)-4\;E}=\frac{-441}{62}\approx-7.11$$
Parabola Ex Snapshot.png
Figure 4: Example Results. The parabola $x^{2}-3xy+\frac{1}{4}y^{2}+15x-7y=-55$. The focus, vertex, and directrix were obtained without having to rotate and un-rotate the parabola.
Focus is $(-5.59,-1.11)$ and Directrix is $y=-(3/2)x-7.11$. The intersection of the line from the Focal point to the directrix has a similar equation to our point $Q$ from figure 3 if we will change $P_{x}$ and $P_{y}$ to $Foc_{x}$ and $Foc_{y}$. Let's call that point $D_{1}$. $$D_{1}=\left(\frac{Foc_{x}+mFoc_{y}-mb}{m^{2}+1},\,\frac{mFoc_{x}+m^{2}Foc_{y}+b}{m^{2}+1}\right)$$ $$D_{1}\approx(-4.49,-0.38)$$ From these two points, $Foc$ and $D_{1}$, calculate the Vertex. $$V=\frac{Foc+D_{1}}{2}\approx(-5.04,-0.74)$$